Repository navigation
Document the precision-at-K denominator for held-out items - #760
Open
justavibedev wants to merge 1 commit into
Open
justavibedev wants to merge 1 commit into
justavibedev wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Users in #412 and #713 got different precision scores from what they expected when some users had fewer than K held-out items. The API docs called the result P@K but didn’t say how the denominator was calculated.
This adds a two-user example to
precision_at_kand a reference fromranking_metrics_at_k. At K=3, one hit each for users with one and three held-out items gives 2 / (1 + 3) = 0.5.I checked the example against the released 0.7.3 wheel and compared both public functions against the documented calculation across 100 small synthetic cases, including users with no held-out items. Codex assisted with the edit and verification.